<?php

namespace App\Http\Resources\Mini\Shop;

use Illuminate\Http\Resources\Json\ResourceCollection;

class KeywordsCollection extends ResourceCollection
{
    /**
     * Transform the resource collection into an array.
     *
     * @param \Illuminate\Http\Request $request
     * @return array
     */
    public function toArray($request)
    {

        $data = $this->collection->map(function ($item) {
            $item->created_at = date('Y-m-d H:i:s', $item->created_at);
            $item->updated_at = date('Y-m-d H:i:s', $item->updated_at);
            return $item;
        });
        return $data;
    }
}
